#include <iostream>
#include <cstring>
#include <stack>

using namespace std;

const int maxn = 500 + 10;
const int inf = 0x3f3f3f3f;

char str[maxn];

int calc(char *str, int l, int r) {
    int pos = -1, tmp = inf - 1;
    for (int i = 0; i <= r; i++) {
        int cur = inf;
        switch(str[i]) {
            case '+':
            case '-': cur = 1; break;
            case '*':
            case '/': cur = 2; break;
        }
        if (cur <= tmp) {
            pos = i;
            tmp = cur;
        }
    }
    // l,r区间内全部都是数字
    if (pos == -1) {
        int num = 0;
        for (int i = 0; i <= r; i++) {
            if (str[i] < '0' || str[i] > '9') continue;
            num = num * 10 + (str[i] - '0');
        }
        return num;
    }
    int a = calc(str, l, pos - 1);
    int b = calc(str, pos + 1, r);
    switch(str[pos]) {
        case '+': return a + b;
        case '-': return a - b;
        case '*': return a * b;
        case '/': return a / b;
    }

    return 0;
}

int main() {

    scanf("%s", str);
    int ans = calc(str, 0, strlen(str) - 1);
    cout << ans << endl;

    return 0;
}
